/*
 * MediaPlayer.h
 *
 *  Created on: Mar 11, 2011
 *      Author: ToanNhan
 */

#ifndef MEDIAPLAYER_H_
#define MEDIAPLAYER_H_

#include <FBase.h>
#include <FMedia.h>
#include <FIo.h>
#include <FBaseByteBuffer.h>

using namespace Osp::Base;
using namespace Osp::Base::Collection;
using namespace Osp::Base::Runtime;
using namespace Osp::Media;
using namespace Osp::Io;

class MediaPlayerListener
    : public Osp::Media::IPlayerEventListener
{
public:
    	MediaPlayerListener(void);
    	void OnPlayerOpened(result r);
    	void OnPlayerEndOfClip(void);
    	void OnPlayerBuffering(int percent);
    	void OnPlayerErrorOccurred(Osp::Media::PlayerErrorReason r);
    	void OnPlayerInterrupted(void);
    	void OnPlayerReleased(void);
};

class MediaPlayer
{
	// Lifecycle
public:
	MediaPlayer(void);
	virtual ~MediaPlayer(void);

// Example Operation
public:
	result PlayMusic(String url);
	result StopMusic();
};

#endif /* MEDIAPLAYER_H_ */
